Compressor control system for a portable ventilator

ABSTRACT

A method and apparatus for controlling a brushless DC (BLDC) motor over a wide range of angular speeds is presented. Analog magnetic sensors provide continuous signal measurements related to the rotor angular position at a sample rate independent of rotor angular speed. In one embodiment, analog signal measurements are subsequently processed using an arctangent function to obtain the rotor angular position. The arctangent may be computed using arithmetic computation, a small angle approximation, a polynomial evaluation approach, a table lookup approach, or a combination of various methods. In one embodiment, the BLDC rotor is used to drive a Roots blower used as a compressor in a portable mechanical ventilator system.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to and is a continuation of U.S. patentapplication Ser. No. 10/847,693, titled “Compressor Control System for aPortable Ventilator,” filed on May 18, 2004, which claims priority toU.S. Provisional Application No. 60/492,421, to Douglas F. DeVries,titled “Portable Ventilator,” filed on Aug. 4, 2003, the disclosures ofwhich are hereby incorporated by reference in their entirety.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to control systems for electric motors, moreparticularly to a control system for an electric motor used to drive acompressor in a portable ventilator.

2. Background Art

For a variety of reasons, there are instances when individuals(patients) with acute and chronic respiratory distress cannot ventilatethemselves (i.e. breathe). In those circumstances, such patients requirebreathing assistance to stay alive. One solution is to provide thosepatients with a medical device called a mechanical ventilator, whichassists with their breathing.

A purpose of a mechanical ventilator is to reproduce the body's normalbreathing mechanism. Most mechanical ventilators create positiveintrapulmonary pressure to assist breathing. Positive intrapulmonarypressure is created by delivering gas to the patient's lungs so thatpositive pressure is created within the alveoli (i.e. the final branchesof the respiratory tree that act as the primary gas exchange units ofthe lung). Thus, a mechanical ventilator is essentially a device thatgenerates a controlled flow of gas (e.g., air or oxygen) into apatient's airways during the inhalation phase, and allows gas to flowout of the lungs during the exhalation phase.

Mechanical ventilators use various types of methods to facilitateprecise delivery of air to the patient. Some ventilators use gascompressors to generate the proper amount of flow to satisfy therequirements of the patient.

Most ventilator systems that have an internal gas source use eitherconstant speed or variable speed compressors. Constant speed compressorsare usually continuously operating, rotary-based machines that generatethe desired flow from external air, for ultimate delivery to thepatient. These constant speed systems generally use a downstream flowvalve to control intermittent patient flow, with a bypass valverecirculating the excess flow.

Variable speed compressors operate by rapidly accelerating from a reststate to produce the flow rate necessary during the beginning of theinhalation cycle, and then decelerating to the rest state at the end ofthe inhalation cycle to allow the patient to exhale.

There are basically two types of variable speed systems employed in themechanical ventilator art: piston-based systems and rotary-basedsystems. Rotary systems require low inertia components for the rapidacceleration and deceleration cycles. For instance, prior art systems,such as that described in U.S. Pat. No. 5,868,133 to DeVries et al, usedrag compressors to provide the desired inspiratory air flow.

Rotary compressor systems deliver the required air flow duringinhalation by accelerating the compression rotor(s) to the desired speedat the beginning of each inspiratory phase and decelerating thecompression rotor(s) to the rest speed at the end of each inspiratoryphase. Thus, the rotary compressor is stopped, or rotated at a baserotational speed prior to commencement of each inspiratory ventilationphase. Upon commencement of an inspiratory phase, the rotary compressoris accelerated to a greater rotational speed for delivering the desiredinspiratory air flow. At the end of the inspiratory phase, therotational speed of the compressor is decelerated to the base speed, oris stopped, until commencement of the next inspiratory ventilationphase. These prior art systems typically use a programmable controllerto control the timing and rotational speed of the compressor.

During operation of the ventilator, it is desirable to precisely controlthe rapid acceleration, deceleration, and rotational speed of the rotarycompressor in order to generate the required inspiratory pressure, flowrate, or volume to the patient. For instance, depending on the size andcapacity of the compressors, it may be necessary to precisely controlthe speed of the motor from zero to approximately twenty thousandrevolutions per minute (20,000 RPM) to generate the desired flow rate.Thus, it may be necessary to accelerate the motor from rest to the fullrotational speed of 20,000 RPM in a relatively small amount of time(e.g., on the order of milliseconds).

One type of electric motor with desirable mechanical characteristics forportable ventilators is a brushless DC (BLDC) motor. BLDC motors havesmall form factors and very high reliability resulting from the lack ofbrushes and reduced frictional components. BLDC motors are reversiblemotors that synchronize the poles of a rotor with a rotating statorfield. Classes of BLDC motors include permanent magnet types andvariable reluctance types.

In BLDC motors that use permanent magnets, the rotor is made of magneticmaterials that provide high flux, resulting in good torque-to-size ratioat moderate cost. The inherent dynamic braking and low rotor speed ofthe permanent magnet design ensure smooth operation and provide the typeof rapid acceleration needed for the inspiratory cycle of a mechanicalventilator. In addition, BLDC motors have very low torque ripple and areeasily controllable over a broad range of speeds.

BLDC motors provide rapid acceleration and deceleration capability, aswell as exceptional efficiency under full load conditions. Thesefeatures are desirable in applications that require performance withminimal power consumption. However, simple BLDC motor controllers (e.g.,controllers that rely solely on commutation states for motor control) donot provide the type of precision speed control required in portableventilator systems. Portable ventilator systems require substantiallyinstantaneous speed detection (e.g., one speed value every two to fourmilliseconds) to provide the necessary transient response in the speedcontrol loop. Speed detection based on sparse commutation stateinformation would have a strong negative impact on the transientresponse of the speed control loop, especially at low speeds.

Simple BLDC motor controllers use a small number of commutation states(e.g., six states for a three-phase device) to describe the rotorposition at any moment in time. Position information is thereforerelatively coarse. For commutation control, this coarse positioninformation is sufficient. For speed control, however, such coarseposition information is problematic. The rate at which commutationposition information is available is equal to the number of commutationstates multiplied by the current speed of the rotor. At higher rotorspeeds, there are more commutation position samples (i.e., statechanges) per unit time, reducing the total amount of time required tocompute an accurate speed value. However, as the rotor speed decreases,the commutation position samples become sparser in time, increasing theamount of time required to compute an accurate speed value. As a result,the speed computations from commutation information provide a transientresponse that is too slow for portable ventilator applications.

In prior art motor control applications, speed control is commonlyassisted through the use of a separate speed transducer, such as anoptical encoder, which enhances the density of position information withrespect to time. Optical encoders typically take the form of a finelynotched or perforated disk attached to the rotor shaft of the BLDCmotor, extending outward from the radius of the shaft. As the rotor anddisk rotate, a light-emitting device (e.g., a light emitting diode(LED)) casts light through the perforations on the disk for detection byone or more photo sensors positioned on the opposite side of the disk.Lenses are sometimes used to focus and direct the light through multipleconcentric tracks of perforations.

Each successive notch or perforation of the disk represents the passageof a known angular distance (e.g., with 1024 notches spaced around thedisk, one notch=2⁻¹⁰ revolutions). A relatively accurate angular speedvalue can be determined by timing the interval between successivenotches, or by counting the number of notches within a fixed sampleperiod.

FIG. 1 is a block diagram of a three-phase BLDC motor controller with anoptical transducer. In this example, three discrete Hall effect sensorslocated in the stator provide rotor position feedback for commutationcontrol. Each discrete Hall effect sensor provides 180 degrees ofposition sensing coverage. Speed feedback is provided by an incrementaloptical transducer (i.e., an optical transducer that detects incrementalchanges in rotor position without reference to an absolute rotorposition).

In FIG. 1, discrete Hall effect sensors 115A-C are located in a circlearound the spinning rotor, approximately 120 electrical degrees apart toprovide full coverage position feedback of the rotor of BLDC motor 110.The binary outputs of discrete Hall effect sensors 115A, 115B, and 115Care connected to a decoder circuit 120 via communication lines 103A,103B, and 103C, respectively.

The one-bit output of each Hall effect sensor goes high when thepositive pole of a magnet attached to the rotor is aligned within the180-degree arc centered on the given sensor. Because there are threesensors 120 degrees apart, there are roughly 60 degrees of sensoroverlap, where the outputs of two sensors are high at the same time(actual region of overlap may depend on the distance between thesensors). Given the above arrangement of sensors, and representing thecombined sensor outputs as a three-bit digital word, the possiblethree-bit values (i.e., states) assigned to rotor positioning are: (1 00), (1 1 0), (0 1 0), (0 1 1), (0 0 1) and (1 0 1). The statetransitions occur at intervals of approximately 60 degrees. Decoder 120extracts the six possible sensor combinations or states and feeds thediscrete information to commutation control circuit 150, which generatessignals for energizing the appropriate stator coils within the motor.

Commutation control 150 provides a commutation signal to PWM generator170, which, in turn, uses pulse-width modulated signals to drivethree-phase inverter block 180. In periodic pulses, three-phase inverterblock 180 sources electrical current to one coil of the stator whilesinking current through another coil. Due to the direction of the coilwindings and the direction of current flow therein, one coil willattract the rotor while the other coil repels. The rotor is thus pulled(and pushed) in the desired direction.

The duty cycles (i.e., the relative pulse-widths) of the signals fromPWM generator 170 determine how long the bursts of drive current lastwithin the stator. By modulating the duty cycle based on the controlsignal received from control function 160, a higher average drivecurrent (or lower average), and a correspondingly stronger (or weaker)pull over time by the stator coils, may be achieved to implementacceleration and deceleration of the rotor.

FIG. 2 illustrates one example of a three-phase inverter coupled to astator having three coils 200A-200C. The coil arrangement shown isbipolar in nature, meaning that the coils share a single neutral node(209), such that when one coil is sourcing current, another coil must besinking current. In this way, one coil will be attracting a first poleof a rotor magnet, and a second coil will be attracting the oppositepole of a rotor magnet and/or repelling the first pole. Unipolararrangements may also be used, where each coil is driven independently,in only one direction.

In FIG. 2, three-phase inverter 180 is implemented with six transistors(201A-B, 202A-B and 203A-B), represented in this example by FETs (fieldeffect transistors). Though not shown, each FET may have a clampingdiode coupled in parallel. FETs 201A, 202A and 203A are shown as P-typetransistors, though they may also be implemented with N-typetransistors. The source nodes of FETs 201A, 202A and 203A are commonlycoupled to positive power supply node 204. Similarly, the source nodesof FETs 201B, 202B and 203B are commonly coupled to ground node ornegative power supply node 205. The drain nodes of FETs 201A and 201Bare commonly coupled to node 206, which is further coupled to coil 200A.The drain nodes of FETs 202A and 202B are commonly coupled to node 207,which is further coupled to coil 200B. Likewise, the drain nodes of FETs203A and 203B are commonly coupled to node 208, which is further coupledto coil 200C.

Control signals A1, B1 and C1 are coupled to the gates of FETs 201A,202A and 203A, respectively, and are responsible for determining whenFETs 201A, 202A and 203A will source current to coils 200A, 200B and200C, respectively. Similarly, control signals A2, B2 and C2 are coupledto the gates of FETs 201B, 202B and 203B, respectively, and areresponsible for determining when FETs 201B, 202B and 203B will sinkcurrent from coils 200A, 200B and 200C, respectively. The control loopdetermines the timing of control signals A1, A2, B1, B2, C1 and C2, topull (and optionally push) the rotor to achieve the desired rotation.

Referring back to FIG. 1, an optical encoder is attached to BLDC motor110. The optical encoder includes LED 104, disk 105 and photo sensor106. The signal output of photo sensor 106 is provided to timer 130.Speed calculation circuit 140 computes the rotor speed using informationavailable from timer 130. That information may include, for example, thetimed interval between detection of consecutive notches or the number ofnotches detected within a fixed time interval. The computed speed 102 isthen compared with speed command 101 to generate a speed error, which isused within control function 160 to generate the modulation controlsignal for PWM generator 170. Control function 160 may be implementedwith, for example, a PI (proportional-integral) controller or a PID(proportional-integral-derivative) controller.

A disadvantage of optical encoders and other speed transducers is thatthe extra hardware of the encoder takes up space in the housing of thedevice and increases the overall weight of the device. Further, opticalencoders are expensive. For larger devices, the increased size, weightand cost may not be important factors in the device design. However, inportable ventilator design, it is desirable that each ventilator unit becompact, lightweight, and affordable. Thus, the additional size, weightand cost of separate speed transducers make them undesirable assolutions for speed control in a portable ventilator.

These shortcomings of prior art BLDC control systems hinder the use ofseparate speed transducers with BLDC motors in mechanical ventilatorapplications. Thus, it is desirable to provide a BLDC motor controlsystem for portable ventilators having accurate rotor speed informationand control at all rotor speeds, without the added cost, size and weightof a separate speed transducer.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram of a BLDC motor controller with a separateoptical encoder.

FIG. 2 is a circuit diagram of a three-phase inverter circuit driving astator with three coils.

FIG. 3 is a block diagram of a compressor assembly in accordance with anembodiment of the present invention.

FIG. 4 is an illustration of a cross-sectional view of amotor/compressor system in accordance with an embodiment of the presentinvention.

FIG. 5 is an illustration of an arrangement of the drive gears in aRoots blower compressor, in accordance with an embodiment of the presentinvention.

FIG. 6 is an illustration of an arrangement of analog Hall sensors on aPC board in accordance with an embodiment of the present invention.

FIG. 7 is a schematic diagram of a pressure control servo in accordancewith an embodiment of the present invention.

FIG. 8 is an illustration of a flow-rate control servo in accordancewith an embodiment of the present invention.

FIG. 9 is an illustration of a speed control servo in accordance with anembodiment of the present invention.

FIGS. 10A and 10B illustrate the positioning of analog Hall sensors withrespect to a BLDC rotor magnet to provide rotor position measurement, inaccordance with an embodiment of the present invention.

FIGS. 11A and 11B are illustrations of sample analog sensor outputsduring BLDC rotor rotation, in accordance with an embodiment of thepresent invention.

FIG. 12 is a flow diagram of a speed servo calibration process inaccordance with an embodiment of the present invention.

FIG. 13 is a flow diagram of a position and speed computation process inaccordance with an embodiment of the invention.

SUMMARY OF INVENTION

The invention provides a control system for a BLDC motor. An embodimentof the present invention controls the airflow provided to a patientusing a brushless DC (BLDC) motor to drive a Roots blower gascompressor. Coupling a Roots blower compressor with a BLDC motorprovides a fully capable compressor in a small, cost-efficient package.Using an embodiment of the present invention, the speed of the BLDCmotor, and hence the air flow rate, may be precisely controlled usingthe outputs of analog Hall effect sensors to calculate angular positionand speed for a speed control servo.

In one embodiment of the invention, analog sensors are located within aBLDC motor assembly to provide continuous signals based on the magneticflux sensed from a magnet attached to the rotor of the motor. Unlike theprior art, sensor signals may be sampled at a sample rate that isindependent of the angular speed of the rotor. Speed and positionaccuracy can therefore be maintained across the full range of rotorspeeds.

In one or more embodiments, the sensor signals are processed in aposition function to obtain the rotor angular position. In accordancewith one embodiment of the invention, one possible position function isthe arctangent function. The arctangent function may be computed, forexample, using an arithmetic computation, a small angle approximation, apolynomial evaluation approach, a table lookup approach, or acombination of various methods. Once the angular position is calculated,the angular speed may be derived by differentiating the angular positionover time.

DETAILED DESCRIPTION

The invention provides a control system for a brushless DC motor thatcan be used to drive a compressor in a portable mechanical ventilator.In the following description, numerous specific details are set forth toprovide a more thorough description of embodiments of the invention. Itwill be apparent, however, to one skilled in the art, that the inventionmay be practiced without these specific details. In other instances,well known features have not been described in detail so as not toobscure the invention.

Mechanical ventilators are normally bulky machines used mostly inhospitals to assist patients who cannot breathe on their own. Recentadvances in technology have resulted in a generation of portablegenerators that can be used outside the hospital. The current trend isto reduce the size and power consumption of mechanical ventilators whileproviding the full capability of full size hospital ventilator units.

Mechanical ventilators create positive intrapulmonary pressure to assistbreathing. Positive intrapulmonary pressure is created by delivering gasto the patient's lungs so that positive pressure is created within thealveoli (i.e. the final branches of the respiratory tree that act as theprimary gas exchange units of the lung). Thus, a mechanical ventilatoris essentially a device that generates a controlled flow of gas into apatient's airways during the inspiratory phase, and allows gas to flowout of the lungs during the exhalation phase. Mechanical ventilators usea gas compressor to generate the required airflow.

The present invention involves the precision speed control of anelectric motor that may be used to drive a compressor in a mechanicalventilator. Mechanical ventilators may have various modes of operation,e.g., pressure control and volume control. One common thread amongstmost mechanical ventilators is that the desired operating mode isachieved by controlling the gas flow rate produced by the gascompressor.

In one embodiment, the motor is a brushless DC (BLDC) motor driving aRoots blower used as a compressor in a portable mechanical ventilator.The flow rate and pressure provided by the compressor are controlled bythe speed of the BLDC motor. Unlike in prior art systems where digitalHall effect sensors are used to provide discrete samples of the rotorposition and separate speed transducers are used to provide speedfeedback of the BLDC motor, embodiments of the present invention employanalog sensors (e.g., analog Hall effect sensors, anisotropicmagneto-resistive (AMR) sensors, etc.) to provide continuous rotorposition and speed feedback for closed loop control.

FIG. 3 is a block diagram of a motor/compressor system in accordancewith an embodiment of the present invention. In this illustration, themotor/compressor system comprises Roots blower 302 coupled to BLDC motor304. Gas (i.e., air) enters Roots blower 302 via inlet 308. The air frominlet 308 is compressed by Roots blower 302, and then passed to thepatient and/or other sections of the mechanical ventilator throughoutlet 310. Fluid communication paths are provided from the input ofRoots blower 302 to solenoid valve 312, and from the output of Rootsblower 302 to solenoid valve 314. Ambient air pressure is also channeledto solenoid valves 312 and 314 via ambient inlets 316 and 318,respectively.

The output fluid communication channels of solenoid valves 312 and 314are provided to blower differential pressure transducer 340 to convertthe pressure differential between the two channels into an electricalsignal representative of that pressure differential. During normaloperation, transducer 340 measures the difference between the outputpressure and input pressure of Roots blower 302. By controlling solenoidvalves 312 and 314, transducer 340 can also measure the pressuredifference between the two ambient pressure inlets during an “auto-zero”phase of transducer 340. Processor 320 provides control of solenoidvalves 312 and 314, with solenoid drivers 232 transforming the digitalcontrol signals from processor 320 into power DC signals capable ofdriving the solenoid valves.

Absolute pressure transducer 322 and temperature transducer 324 generateelectrical signals representing the absolute pressure level and thetemperature. Each of transducers 322, 324 and 340 are coupled totransducer (XDCR) interface block 326, which may provide signalamplification and filtering of the analog signals that are then providedto A/D (analog-to-digital) converter circuit 338. A/D converter 338transforms the analog signals into digital values that may be processedby processor 320.

In addition to A/D converter circuit 338, Processor 320 also has thefollowing associated circuitry: flash memory 348, JTAG test circuitry346, random access memory (RAM) 344, and UARTs (universal asynchronousreceiver-transmitters) 342 and 336. External JTAG connector 350 iscoupled to JTAG circuit 346 to facilitate hardware tests and debuggingin accordance with the JTAG standard. Telemetry connector 352 is coupledto UART 342 for the transmission of measured ventilator parameters to aremote system, e.g., for monitoring purposes. Communication and powerconnector 354 is coupled to UART 336 for facilitating further externalcommunication with the ventilator system, e.g., for operational testingand control. Connector 354 also provides any necessary power signals tothe motor/compressor system (e.g., 3.3, 5.0 and/or 15 VDC (volts DC)).

Analog sensors 306 (e.g., analog Hall effect sensors) are arranged on aPC board in a circular pattern perpendicular to the rotor shaft of BLDCmotor 304 and adjacent to a two-pole magnet attached to the end of therotor shaft. Analog sensors 306 provide measurements needed forcomputation of BLDC rotor position. The analog outputs of sensors 306are passed through sensor interface 328 (e.g., for amplification andfiltering), and then into A/D converter circuit 338, where the analogsensor signals are converted into digital values for processing withinprocessor 320.

Processor 320 executes software instructions to implement certainelements of the motor/compressor control loop, as will be described indetail later in this specification. Processor 320 may be implemented,for example, with a general purpose processor or with a digital signalprocessor (DSP). Other embodiments may implement the functionality ofprocessor 320 in firmware (e.g., instructions stored in an EPROM) or asequivalent logic in a hardware device (e.g., an ASIC (applicationspecific integrated circuit) or an FPGA (field programmable gatearray)).

Processor 320 receives the digitized sensor signals and pressuremeasurements via A/D converter block 338 (values may use RAM 344 fortemporary storage), and determines an appropriate speed control valuebased upon the control process implemented (e.g., pressure control orvolume control). Processor 320 also generates the appropriatecommutation control signals given the current commutation state, andmodulates the pulse widths of those commutation control signals based onthe speed control value. The modulated commutation control signals areprovided to three-phase inverter 330.

Three-phase inverter 330 generates drive signals for the individualstator coils in BLDC motor 304, as previously described. The system mayalso include a current limit circuit 334 coupled to three-phase inverterblock 330.

FIG. 4 is an illustration of a cross-sectional view of amotor/compressor system, in accordance with an embodiment of the presentinvention. This illustration presents the basic internal components ofthat motor/compressor system. In this illustration, the BLDC motor (400)end of the motor/compressor system comprises sensor PC board 410, whichprovides support for a plurality of analog sensors 401A-D (See FIG. 6);rotor shaft 416; rotor 402; magnet 412 attached at the BLDC end of rotorshaft 416; and stator 414. The Roots blower end comprises load bearings418 and 422, impellers 430 and 428, shafts 416 and 426, and gears 424.The arrangement of gears 424, at the end of rotor shaft 416 oppositeBLDC motor 400, is more clearly shown in FIG. 5.

In operation, the BLDC motor controller energizes stator 414 to causerotor 402 to rotate. The rotation of rotor 402 causes rotor shaft 416 toturn a first impeller 430. Rotor shaft 416 also drives gears 424, whichin turn drive shaft 426 and the second impeller 428 of the Roots blower.The operation of impellers 430 and 428 draws air into the Roots blowerthrough a port on one side of the motor/compressor system, and forcesthe air out a second opposing port at a desired pressure/flow rate.Magnet 412 rotates at one end of shaft 416, eliciting a sensor responsefrom analog sensors 401A-D, which is processed in the servo loops (notshown) of the BLDC motor controller to control the angular speed ofrotor 402.

The Roots blower provides the appropriate gas flow rate to achievepositive pressure ventilation (positive intrapulmonary pressure) in apatient. Generally, gas flow produced by a mechanical ventilator eithertargets a desired volume with variable pressure, or controls thepressure while allowing the volume to vary. In an embodiment of thepresent invention, each ventilator mode has its own servo loop wrappedaround an inner motor speed control loop. The various control modes arediscussed below.

Components of the various servo loops described below may be logicallyimplemented within the blower assembly itself (e.g., as softwareexecuted by processor 320 or as hardware circuitry), or components maybe implemented on an external processor (not shown) that is incommunication with the blower assembly. For example, in one embodiment,processor 320 implements the flow rate and speed control servos on PCboard 410, while the pressure control logic is implemented by a secondventilator processor that is external to the roots blower assembly, butin communication with processor 320 via a serial link.

Pressure Control Mode

The pressure control mode involves controlling the inspiratory pressurefor the duration of the inhalation cycle. In this mode, the Roots bloweris required to provide a flow-rate to the patient to achieve a specificwaveform or pressure profile. A schematic diagram of the pressurecontrol servo mode is shown in FIG. 7. As illustrated, the desiredpressure 701 is compared against the actual pressure 703 developed inthe patient's airway to generate an error, which is compensated in block710 to generate a flow-rate command. The compensation in block 710 mayinclude circuits such as PID controllers(Proportional-Integral-Derivative Controllers) and pressure to flow rateconversion factors.

The flow-rate command is subsequently passed to the flow rate controlservo 720, which commands the Roots blower to generate the desired gasflow rate. The flow rate may vary depending on how much gas is needed tosatisfy the pressure requirement. The flow rate servo is discussedbelow.

Volume Control Mode

In the volume control mode, a desired amount of air is delivered to thepatient's lungs during the inspiratory cycle. Thus, during inhalation,the ventilator is providing a desired gas flow rate to the patient. FIG.8 is an illustration of the flow-rate control servo in accordance withan embodiment of the present invention.

As illustrated, the flow-rate command 801 is compared against the actualflow rate 803 in compensation block 810. The actual flow rate 803 may beestimated by using the computed motor speed and measured blowerdifferential pressure 240 in a blower characteristic function 830.Characteristic function 830 may be determined empirically, for example,by observing what the flow rate of the compressor is at known compressorspeeds and differential pressures.

The flow-rate error is compensated in block 810 to generate a BLDC motorspeed command. The compensation in block 810 may include circuitsincorporating any combination of proportional, integral, and derivativecontrollers (e.g., PI or PID controllers). The speed command issubsequently passed to the speed servo 820, which commands the Rootsblower to generate the desired motor speed needed to satisfy the flowrequirement.

Speed Control Servo

FIG. 9 is an illustration of a speed control servo in accordance with anembodiment of the present invention. In this illustration, the speedcontrol servo comprises controller 960; speed calculation module 940;commutation control circuit 950; position computation module 930;analog-to-digital converter (ADC) circuit 920; pulse-width modulation(PWM) generator circuit 170; three-phase inverter circuit 180; BLDCmotor 910; and analog sensors 401A-D.

Controller block 960 compares the desired motor speed (i.e. speedcommand 101) with the actual motor speed 902 to generate a speed error.The speed error is appropriately compensated and integrated, ifnecessary, to generate a duty cycle command to PWM generator 170. PWMgenerator 170 generates modulated control signals, which three-phaseinverter 180 uses to drive the stator coils of BLDC motor 910.

Though the commutation circuit is described herein with respect to athree-phase inverter, the present invention may be practiced with anycommutation circuit incorporating any number of commutation phases,coils and/or rotor magnets.

The BLDC rotor position is measured using multiple analog sensors (e.g.analog Hall effect sensors or AMR sensors) 401A-D. In one embodiment,the analog sensors produce sine and cosine (quadrature) signals fromwhich the rotor angular position may be derived. The outputs of theanalog sensors are converted to digital equivalents in ADC block 920,and the digitized sine and cosine signals are used to compute rotorangular position in position computation block 930. The sample rate ofADC block 920 may be set to any value sufficiently high to provideproper commutation at the highest desired speed. Because the quadraturesensor readings are continuous analog signals, the ADC sample rate maybe set independently of the angular speed of the rotor, and the samplerate can remain constant over the entire range of angular speeds.Finally, the computed angular position is used to compute the actualrotor speed in block 940, and used in commutation control block 950 tosend commutation control signals to PWM generator 170.

FIG. 10A is plane view of PC board 410 showing the radial positioning ofthe analog sensors 401A-401D with respect to magnet 412 and the axisformed by rotor shaft 416, in accordance with one embodiment of theinvention. Magnet 412 is shown centered on the rotor shaft axis. Magnet412 may be located at the tip of the BLDC rotor, or at any otherlocation in the BLDC assembly where the sensors can sense the magneticflux. The radius of Magnet 412 is represented in FIG. 10A by “R_(M)”.The four analog sensors are positioned at an equal radial distance“R_(S)” from the central axis of shaft 416, and offset from each otherby approximately 90 degrees around that axis. The physical offset of 90degrees provides for a corresponding phase offset of 90 degrees in thesensor sinusoidal outputs.

FIG. 10B is a side view of the BLDC motor and control portion of theblower assembly, showing the axial offset between analog sensors401A-401D and magnet 412. Magnet 412 is shown attached to the end ofrotor shaft 416 and analog sensors 401A-401D are attached to PC board410. The axial offset “Z” from the surface of each analog sensor to thesurface of magnet 412 is minimized to prevent weakening of sensor signalstrength, while maintaining sufficient distance to avoid any contact orundesired friction effects due to hardware alignment deviations withinprescribed design tolerances. In one embodiment, for example, Z isapproximately 0.052 inches.

Referring back to the illustration of FIG. 10A, the strength andcharacteristics of the outputs of the analog sensors depend on theradial distance (R_(S)) of the analog sensor relative to the radius(R_(M)) of magnet 412, or more accurately, the absolute distance betweenthe analog sensor and the surface of magnet 412:(Z²+(R_(S)−R_(M))²)^(0.5). Most analog sensors have characteristics suchthat as R_(S) approaches R_(M), the sensor signal strength getsstronger, but the signal quality becomes less ideal in terms of theshape of the output signals (e.g., the signals become more square innature). The converse is also true, i.e., the shape of the sensor signalimproves as R_(S) increases relative to R_(M), but the signal strengthdiminishes. In one or more embodiments, the optimal location may bedetermined experimentally. In one embodiment, the radial distance R_(S)may be approximately 0.17 inches, and the radius R_(M) may beapproximately 0.09 inches, for example.

Other embodiments of the invention may use any number of sensorsadequate to provide analog position signals that may be used tocalculate the rotor angular position. Providing pairs of opposingsensors (i.e., 180 degrees offset), however, and subtracting oneopposing sensor's signal from the other can provide performanceadvantages, such as an improved signal-to-noise ratio. In embodimentswhere the sensors (or sensor pairs) are offset from each other by aknown amount other than 90 degrees, the phase difference may beaccounted for in the position calculation.

In the illustration of FIG. 10A, assuming the position of magnet 412 asshown represents zero degrees and the direction of rotation iscounter-clockwise, the outputs of sensors 401A and 401C approximate thesine and negative sine, respectively, of the rotor angular position. Theoutputs of sensors 401B and 401D (being approximately 90 degrees offsetfrom the outputs of sensors 401A and 401C) approximate the cosine andnegative cosine of the rotor angular position.

By subtracting the output of sensor 401C from the output of sensor 401A,and subtracting the output of sensor 401D from the output of sensor401B, sine and cosine signals are obtained with approximately twice theamplitude of each sensor signal alone. Further, minor deviations in thesinusoidal profiles (e.g., due to unequal magnetic strength between thepoles of the magnet, or slight misalignment of the magnet with respectto the center of the rotor shaft axis) may be diminished or canceled outby the combination of signals from opposing sensors.

FIG. 11A is an illustration of sample outputs of the four analog sensorsof FIG. 10A while the BLDC rotor is rotating. Following the discussionabove, signal waveform 1102 represents the output of sensor 401A, andsignal waveform 1104 represents the output of sensor 401C. Signalwaveform 1108 represents the output of sensor 401B, and signal waveform1106 represents the output of sensor 401D. If waveform 1104 issubtracted from waveform 1102, the resultant is signal 1110 withcharacteristics of a sine function and twice the magnitude of either ofsignals 1104 and 1102. Because the operation is differential, mostelectrical or common mode noise is eliminated. By the same token,subtracting waveform 1106 from waveform 1108 provides signal 1112 withcharacteristics of a cosine function and twice the magnitude of eitherof signals 1106 and 1108.

FIG. 11B illustrates how waveforms 1106, 1108 and 1112 are altered undercircumstances where magnet 412 is offset from the center of rotor shaft416 by some small distance, such that the north pole of the magnetrotates closer to the analog sensors than the south pole. As shown, thepositive portions of waveforms 1106 and 1108 are boosted by the nearerrotation of the north pole. The negative portions of waveforms 1106 and1108 are affected in the opposite manner, showing a diminishedmagnitude. Further, the zero crossings of both waveforms are shifted inposition. Use of either sensor signal alone to determine angularposition would yield erroneous results. However, as shown by waveform1112, the subtraction of waveform 1106 from 1108 yields a substantiallysinusoidal result, correcting for the magnitude distortion and the zerocrossing shifts.

Given the sine and cosine of the rotor angular position, the actualrotor angular position may be obtained using various computationaltechniques. For instance, in processor 320, the angular position may begenerated by computing an angular position function that corresponds tothe arctangent of selected quotients of the sine and cosine signals. Thearctangent function may be computed using an arithmetic computation, asmall angle approximation, a polynomial evaluation approach, a tablelookup approach, or a combination of various methods.

The polynomial approach involves generating and storing coefficients foreach signal in each quadrant. For instance, the coefficients may begenerated in the laboratory by obtaining multiple measurements of thesignals for known rotor angular positions in each quadrant, and thenusing a Least Squares Fit approximation to solve for the coefficients.

For example, coefficient determination may be performed as part of aninitial device calibration process, as shown in the flow diagram of FIG.12. According to one embodiment of such a calibration process, thestator is commutated to achieve a constant angular speed of the rotor instep 1200. This may be done, for example, by using a simple counter toact as the angular position measurement of the rotor. The counter may beaccelerated, while the drive current to the stator coils is ramped downfrom a large initial value to a smaller steady state value. This allowsthe rotor to synchronize with the stator and stabilize. With the rotorspinning at a constant speed, readings may be obtained from the analogsensors in step 1201. In step 1202, readings from opposing sensors arecombined as previously described to provide sinusoidal waveforms 1110and 1112.

In step 1203, the minimum and maximum values of waveforms 1110 and 1112may be measured and recorded, preferably but not necessarily overseveral rotations of the rotor. Those minimum and maximum values maythen be used to determine any DC offsets in the sensor values that needto be compensated. Those DC offset values may be used to compensate thecalibration sinusoidal waveform data, and may also be stored for use incompensating sensor waveform data during normal operation of the device.

After obtaining DC-compensated readings for the sinusoidal waveforms, instep 1204, the commutation correction angle, that is, the angular offsetbetween the position for the magnet and the simultaneous position of therotor. In one embodiment, the zero crossings of the sinusoids may beused to identify the commutation correction angle. For example, a zerovalue from waveform 1110 combined with a positive value from waveform1112 indicates an angular position of zero degrees for magnet 412. Thecorresponding commutation angle (determined from the counter) representsthe commutation correction angle. This correction angle is needed due tosmall phase misalignments between the magnet and the rotor that mayoccur during manufacturing.

In step 1205, sensor readings and the corresponding actual positionvalues from the counter may be used to derive coefficients for eachquadrant of rotation. The derived coefficients are stored, indexed byquadrant, for use in computing position values during normal operation.

An example Least Squares Fit approach that may be used to obtain thecoefficients is illustrated as follows:

Assuming the following generalized Least Squares Fit equation:L=(H ^(T) H)⁻¹ H ^(T) Z

Where L is a vector of coefficients (e.g. three coefficients may beadequate if the polynomial equation used to compute the rotor angularposition involves three elements: sine, cosine, and a bias), and H and Zare measured sensor and position data, respectively. If L contains threecoefficients, then H may be a matrix containing in each row, the sine(s), the cosine (c), and a constant (i.e. one) for each known angularrotor position. Z is a column vector containing each known angular rotorposition (p). Thus, the H matrix and the Z vector may be as illustratedbelow: $\begin{matrix}{{H = \begin{bmatrix}s_{1} & c_{1} & 1 \\s_{2} & c_{2} & 1 \\s_{3} & c_{3} & 1 \\\vdots & \quad & \quad \\\vdots & \quad & \quad \\\vdots & \quad & \quad \\s_{n} & c_{n} & 1\end{bmatrix}},} & {Z = \begin{bmatrix}p_{1} \\p_{2} \\p_{3} \\\vdots \\\vdots \\\vdots \\p_{n}\end{bmatrix}}\end{matrix}$

The H matrix and Z vector are populated with the measured sensor andposition data, and then used to solve the Least Squares Fit equationabove. The resulting column vector of coefficients L=[l₁, l₂, l₃] (whichmay be derived separately for each quadrant or other subset of arotation) may be applied in the polynomial equation below to obtainrotor angular position Φ from any pair of sensor values. Thecoefficients l₁, l₂, and l₃ may be stored, indexed by quadrant, inmemory, such as the flash memory of processor 320.Φ=l ₁ sin(Φ)+l ₂ cos(Φ)+l ₃

Where sine(Φ) and cosine(Φ) are the outputs from the respective sensorpairs. Note that the coefficients may be determined such that thecomputed rotor angular position overlaps into the adjoining quadrants.

The process of determining the least squares fit may be performed, forexample, in processor 320, in a calibration application executing onanother processor connected serially to processor 320, or in bothprocessor 320 and in a calibration application executing on anotherprocessor (external or internal).

FIG. 13 is a flow diagram of a position and speed computation processused during normal operation, in accordance with an embodiment of theinvention. In step 1300, sensor readings are obtained for the currentsample interval in accordance with a desired sample rate. In step 1301,those sensor readings are combined as previously described (i.e., byapplying subtraction to readings of opposing sensors), and in step 1302,DC correction (determined during the calibration process) may be appliedto the combined readings. The current position is derived from thesensor readings by identifying the current quadrant in step 1303, andlooking up the appropriate stored coefficients in step 1304. The currentquadrant may be easily identified, in one embodiment, by analyzing thesigns of the combined sensor readings. For example, when both readingsare positive, the current quadrant is the first quadrant (i.e., zero toninety degrees).

In step 1305, the current coefficients and combined readings are used tosolve the angular position equation and yield a computed position value.In step 1306, the commutation correction angle may be added to thecomputed position value to generate the actual position value for use incommutation control. If, during calibration, the correction angle wasapplied to the position values prior to deriving the quadrantcoefficients, then the correction angle need not be re-applied duringnormal operation, because the correction angle is already accounted forwithin the derived coefficients.

The angular speed is computed in step 1307 (which preferably occursafter step 1305 because the commutation correction angle is irrelevantto the speed computation) by taking the derivative of the computedposition values, e.g., subtracting the stored position of the priorsample interval from the current position, and multiplying the result bythe sampling frequency. Multiplying the position difference by thesampling frequency may be omitted if the speed command from the flowrate servo is normalized appropriately. At the next sample interval, theposition and speed computation process begins once more at step 1300.

In another embodiment, a grid of possible angular position assignmentsto both sensor pair measurements allows implementation of a look-uptable for assigning the angular position measurement to the readings ofthe sensor signals. Thus, a reading may be assigned or dismissed so thatthe update is omitted if the signals are outside the limits associatedwith acceptable angular positions.

A table lookup embodiment may automatically assign a predeterminedangular position to each pair (sine and cosine) of valid coordinates orskip a position update when either of the sine and cosine data is not tobe trusted. Thus, using a table lookup to compute the phase angle allowsfor elimination of signals that cannot be trusted for accuracy andprovides for sparse real-time computation of the quotients and inversetrigonometric functions (arctangent).

In other embodiments, the angular position computation process may bedone entirely in the analog domain. In such embodiments, the ADC 920 maynot be required to convert the sensor outputs to digital form beforecomputation of the arctangent. The arctangent may be approximated forsmall angles by the tangent obtained from the analog division of thesine and the cosine signals. Such analog division can be implemented byplacing a multiplier in the feedback path of an analog multiplierdevice.

After obtaining the rotor angular position and speed, the position andspeed signals may also be filtered using some form of low-pass filter.For instance, an Infinite-Impulse Response (IR) filter may be employed.An appropriate bandwidth will depend on the sampling rate of theprocessor, how much delay is tolerable, and the electrical noisecharacteristics of the environment of the BLDC motor.

Thus, a control system for a BLDC motor has been described. Particularembodiments described herein are illustrative only and should not limitthe present invention thereby. The invention is defined by the claimsand their full scope of equivalents.

1-35. (canceled)
 36. A portable ventilator apparatus comprising: acompressor disposed within the portable ventilator; a brushless directcurrent (BLDC) motor, said compressor driven by said BLDC motor; aplurality of sensors disposed within the portable ventilator thatprovide a plurality of analog signals, said plurality of analog signalsrepresentative of an angular position of said BLDC motor; a computationcircuit disposed within the portable ventilator and in communicationwithin the plurality of sensors configured to compute said angularposition of said BLDC motor from said plurality of analog signals; and aspeed control servo disposed within the portable ventilator and incommunication with said BLDC motor for driving an angular speed of theBLDC motor to a command speed provided to said computation circuit. 37.The apparatus of claim 36, wherein each of said plurality of sensorscomprises an analog Hall effect sensor.
 38. The apparatus of claim 36,wherein each of said plurality of sensors comprises an anisotropicmagneto-resistive (AMR) sensor.
 39. The apparatus of claim 36, whereinsaid plurality of analog sensors is four analog sensors arranged ninetydegrees apart from each other in a circular pattern.
 40. The apparatusof claim 36, wherein said command speed is calculated by a flow-ratecontrol loop to provide a required flow-rate through said compressor.41. The apparatus of claim 40, wherein said required flow rate iscalculated by a pressure control function.
 42. The apparatus of claim36, wherein said computation circuit comprises a processor.
 43. Theapparatus of claim 36, wherein said computation circuit computes saidangular position from said plurality of analog signals using anarctangent function.
 44. The apparatus of claim 36, wherein saidcomputation circuit computes said angular position from said pluralityof analog signals using a table lookup function.
 45. The apparatus ofclaim 36, wherein said computation circuit computes said angularposition from said plurality of analog signals using polynomialevaluation.
 46. The apparatus of claim 36, further comprising ananalog-to-digital converter which samples said plurality of analogsignals at a constant sample rate, and which provides correspondingdigital values to said computation circuit.
 47. The apparatus of claim36, wherein said computation circuit comprises a plurality of storedcoefficient values for computing said angular position from a polynomialequation.
 48. The apparatus of claim 47, wherein said plurality ofcoefficient values comprises a set of coefficients associated with eachquadrant of a rotation.
 49. The apparatus of claim 36, wherein saidspeed control servo drives the BLDC motor in accordance with saidangular position.
 50. A portable ventilator apparatus comprising: acompressor disposed within the portable ventilator; a brushless directcurrent (BLDC) motor, said compressor driven by said BLDC motor; aplurality of sensors disposed within the portable ventilator thatprovide a plurality of analog signals, said plurality of analog signalsrepresentative of an angular position of said BLDC motor; a computationcircuit disposed within the portable ventilator and in communicationwith the plurality of sensors configured to compute an angular speed ofsaid BLDC motor from said plurality of analog signals; and a speedcontrol servo disposed within the portable ventilator and incommunication with said BLDC motor for driving said angular speed of theBLDC motor to a command speed provided to said computation circuit. 51.The apparatus of claim 50, wherein each of said plurality of sensorscomprises an analog Hall effect sensor.
 52. The apparatus of claim 50,wherein each of said plurality of sensors comprises an anisotropicmagneto-resistive (AMR) sensor.
 53. The apparatus of claim 50, whereinsaid plurality of analog sensors is four analog sensors arranged ninetydegrees apart from each other in a circular pattern.
 54. The apparatusof claim 50, wherein said command speed is calculated by a flow-ratecontrol loop that provides a required flow-rate through said compressor.55. The apparatus of claim 54, wherein said required flow rate iscalculated by a pressure control function.
 56. The apparatus of claim50, wherein said computation circuit comprises a processor.
 57. Theapparatus of claim 50, wherein said computation circuit computes saidangular position from said plurality of analog signals using anarctangent function.
 58. The apparatus of claim 50, wherein saidcomputation circuit computes said angular position from said pluralityof analog signals using a table lookup function.
 59. The apparatus ofclaim 50, wherein said computation circuit computes said angularposition from said plurality of analog signals using polynomialevaluation.
 60. The apparatus of claim 50, further comprising ananalog-to-digital converter which samples said plurality of analogsignals at a constant sample rate, and which provides correspondingdigital values to said computation circuit.
 61. The apparatus of claim50, wherein said computation circuit comprises a plurality of storedcoefficient values for computing said angular position from a polynomialequation.
 62. The apparatus of claim 61, wherein said plurality ofcoefficient values comprises a set of coefficients associated with eachquadrant of a rotation.
 63. A portable ventilator apparatus comprising:a compressor disposed within the portable ventilator; a brushless directcurrent (BLDC) motor, said, compressor driven by said BLDC motor; aplurality of sensors disposed within the portable ventilator thatprovide a plurality of analog signals, said plurality of analog signalsrepresentative of an angular position of said BLDC motor; a computationcircuit disposed within the portable ventilator and in communicationwith the plurality of sensors configured to compute an angular speed ofsaid BLDC motor from said plurality of analog signals; and a speedcontrol servo disposed within the portable ventilator and incommunication with said BLDC motor for driving said angular speed of theBLDC motor to a command speed provided in said computation circuit. 64.The apparatus of claim 63, wherein said BLDC motor has a rotor having arotor shaft having a rotor shaft tip and forming a rotor shaft axis,further comprising: a PC board positioned perpendicular to said rotorshaft of said BLDC motor; wherein said sensors are each positioned onsaid PC board at an equal radial distance from the rotor shaft axis. 65.The apparatus of claim 64, wherein a magnet, having a radius, is placedon said rotor shaft tip.
 66. The apparatus of claim 65, wherein saidradial distance from the rotor shaft axis and each of said sensors is0.17 inches, and wherein the radius of said magnet is 0.09 inches. 67.The apparatus of claim 65, wherein said radial distance from the rotorshaft axis and each of said sensors is less than 0.17 inches.
 68. Theapparatus of claim 65, wherein said radial distance from the rotor shaftaxis and each of said sensors is greater than 0.17 inches.
 69. Theapparatus of claim 65, wherein each of said plurality of sensors areplaced adjacent to said magnet.